package org.huangrui.javaee.controller;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.huangrui.javaee.service.CouponService;
import org.huangrui.javaee.service.CouponServiceV2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 一次性下发 100W 优惠卷实例
 * @Author hr
 * @Create 2025-11-03 0:36
 **/
@Slf4j
@RestController
public class T02CouponController {
    @Resource
    private CouponService couponService;

    // http://localhost:23456/coupon/sendv1
    @GetMapping(value = "/coupon/sendv1")
    public void sendv1() {
        couponService.batchTaskAction();
    }

    @Resource
    private CouponServiceV2 couponServiceV2;

    // http://localhost:23456/coupon/sendv2
    @GetMapping(value = "/coupon/sendv2")
    public void sendv2() {
        couponServiceV2.batchTaskActionV2();
    }
}
